import { createRouter, createWebHistory } from 'vue-router'
import Layout from "@/views/Layout.vue";
import LoginBar from "@/views/login/Bar.vue";
import TeamInfo from "@/views/team/Info.vue";
import Home from "@/views/manager/Home.vue";
import UserUpdate from "@/views/user/Update.vue";
import DashboardInfo from "@/views/dashboard/Info.vue";
import DashboardCreate from "@/views/dashboard/Create.vue";
import DashboardView from "@/views/dashboard/View.vue";
import LogRealtime from "@/views/log/Realtime.vue";
import DeploymentCategory from "@/views/deploy/Category.vue";
import DeploymentHost from "@/views/deploy/Host.vue";
import DeploymentRelease from "@/views/deploy/Release.vue";
import AutoLogInfo from "@/views/autoLog/Info.vue";
import AutoLogConfiguration from "@/views/autoLog/Configuration.vue";
import AlertInfo from "@/views/alert/Info.vue";
import AlertDetail from "@/views/alert/Detail.vue";
import BigScreen from "@/views/dashboard/BigScreen.vue";

const router = createRouter({
    history: createWebHistory('/'),
    routes: [
        { path: '/login', component: LoginBar },
        {
            path: '/', component: Layout, redirect: '/team/info', children: [
                // {path: '/home', component: Home},
                { path: '/user/update', component: UserUpdate },
                // 成员管理
                { path: '/team/info', component: TeamInfo },
                // 仪表盘
                { path: '/dashboard/info', component: DashboardInfo },
                { path: '/dashboard/create', component: DashboardCreate },
                { path: '/dashboard/view', component: DashboardView },
                { path: '/dashboard/bigscreen', component: BigScreen },
                // 日志
                { path: '/log/realtime', component: LogRealtime },
                // 系统日志监控
                { path: '/deployment/systemLogMonitoring', component: () => import('@/views/deploy/systemLogMonitoring/index.vue') },
                // 部署管理
                { path: '/deployment/category', component: DeploymentCategory },
                { path: '/deployment/host', component: DeploymentHost },
                { path: '/deployment/release', component: DeploymentRelease },
                // 自动报告
                { path: '/autoLog/info', component: AutoLogInfo },
                { path: '/autoLog/configuration', component: AutoLogConfiguration },
                // 只能告警
                { path: '/alert/info', component: AlertInfo },
                { path: '/alert/detail', component: AlertDetail },
                { path: '/alert/config', component: () => import('@/views/alert/config.vue') },
                { path: '/alert/action', component: () => import('@/views/alert/action.vue') },
                { path: '/alert/log', component: () => import('@/views/alert/log.vue') },
            ]
        },
    ]
})

export default router
